package fifthwork.two.inherit;

import fifthwork.two.Shape;

/**
 * @author ：chenzikang
 * @date ： 2020/3/24
 */


/**
 * 矩形的继承类
 */
public class RecTangleShape extends Shape {

    public RecTangleShape(double longNum, double wideNum){
        this.longNum=longNum;
        this.wideNum=wideNum;
    }
    //矩形的长
    private double longNum;

    //矩形的宽
    private double wideNum;


    //属性对应的getter，setting方法
    public double getLongNum() {
        return longNum;
    }

    public void setLongNum(double longNum) {
        this.longNum = longNum;
    }

    public double getWideNum() {
        return wideNum;
    }

    public void setWideNum(double wideNum) {
        this.wideNum = wideNum;
    }

    //对抽象类中的方法重载
    @Override
    public double area() {
        return getLongNum()*getWideNum();
    }
}
